/*
 * @(#)JotsException.java	1.0 2000/12/14
 *
 * Copyright 2000 Thomas Barnekow. All Rights Reserved.
 *
 * This software is the proprietary information of Thomas Barnekow.
 * Use is subject to license terms.
 */

package tb.jots;

import java.io.*;

/**
 * This is the base class for all JOTS exceptions.
 *
 * @author Thomas Barnekow
 * @version 1.0
 */
public class JotsException extends Exception {
	public JotsException() {
		super();
	}

	public JotsException(String message) {
		super(message);
	}

	public JotsException(String message, Throwable ex) {
		super(createMessage(message, ex));
	}

	protected static String createMessage(String message, Throwable ex) {
		StringWriter sw = new StringWriter();
		PrintWriter out = new PrintWriter(sw, true);

		out.println(message);
		ex.printStackTrace(out);

		return sw.toString();
	}
}
